#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
using namespace std;


int main() {
  int i,j , k, res, count;
  string s;
  cin >> s;
  res = 0;
  for (j = 0; j < s.size(); ++j) {
     count = 0;
    for (i = j; i < s.size(); ++i)
      if (s[i] == '+') count++, res = max(res, abs(count));
      else count--, res = max(res, abs(count));
  }
  cout << res << endl;
  return 0;
}
